package com.code.entity.composite;

public class Dependency extends NodeComponent {
    private String groupId;
    private String artifactId;
    private String version;

    public Dependency(String groupId, String artifactId, String version) {
        this.groupId = groupId;
        this.artifactId = artifactId;
        this.version = version;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public String build(String nbsp) {
        StringBuilder builder = new StringBuilder();
        builder.append(nbsp).append("<groupId>").append(groupId).append("</groupId>").append("\n");
        builder.append(nbsp).append("<artifactId>").append(artifactId).append("</artifactId>").append("\n");
        builder.append(nbsp).append("<version>").append(version).append("</version>");
        return builder.toString();
    }
}
